<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><block name="title">Huason博客</block></title>
    <link rel="shortcut icon" href="__IMG__/logo_60_60.png">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__CSS__/global.css" media="all">
    <block name="stylesheets">
    </block>
</head>
<body>
    <div class="layui-header header" id="header">
        <div class="layui-main">
            <a class="logo" href="/" title="Huason"><img src="__IMG__/logo.png"></a>    
            <ul class="layui-nav" lay-filter="top_nav">
                <foreach name="menu_list" key="menu_identifier" item="menu">
                <if condition="empty($menu['children'])">
                <li class="layui-nav-item <if condition="$menu_identifier == $identifier">layui-this</if>">
                <a href="{$menu.url}">{$menu.name}</a>
                </li>
                <else/>
                <php> $ident = current(explode('.',$identifier));</php>
                <li class="layui-nav-item <if condition="$menu_identifier == $ident">layui-this</if>">
                    <a href="{$menu.url}">{$menu.name}</a>
                    <dl class="layui-nav-child">
                        <foreach name="menu.children" key="childrenmenu_identifier" item="childmenu">
                        <dd <if condition="($menu_identifier.'.'.$childrenmenu_identifier) == $identifier">class="layui-this"</if>><a href="{$childmenu.url}">{$childmenu.name}</a></dd>
                        </foreach>
                    </dl>
                  </li>
                </if>
                </foreach>
            </ul>
            <div class="search">
                <form class="layui-form" action="{:U('/search')}" method="GET">
                <input type="text" class="search_input layui-input" id="search_val" name="param" placeholder="搜文章">
                <button type="submit" class="search_btn layui-btn-normal"><i class="layui-icon" id="search">&#xe615;</i></button>
                </form>
            </div>
            <div class="login">
                <if condition="session('openid') && ($reply_message_num + $reply_review_num) gt 0">
                <a href="{:U('user/message')}" class="news">{$reply_message_num+$reply_review_num}</a>
                </if>
                <ul class="layui-nav layui-show">
                    <if condition="!session('openid')">
                    <li class="layui-nav-item">
                        <a title="qq登录" href="{:U('/qq_login')}" type="qq_login"><i class="iconfont qqlogin">&#xe631;</i></a>
                    </li>
                    <else/>
                    <li class="layui-nav-item">
                        <foreach name="user" item="us">
                        <img src="{$us.avatar}" class="layui-circle" alt="{$us.nickname}" title="{$us.nickname}">
                        <a type="nickname" class="layui-hide">{$us.nickname}</a>
                        <a type="master_id" class="layui-hide">{$us.id}</a>
                        <span type="openid" class="layui-hide">{$us.openid}</span>
                        <dl class="layui-nav-child">
                            <dd><a href="{:U('/u/'.md5($us['openid']))}" id="qq_logout">个人中心</a></dd>
                            <dd><a href="{:U('/qq_logout')}" id="qq_logout">退出</a></dd>
                        </dl>
                        </foreach>
                      </li>
                    </if>
                </ul>
            </div>
        </div>
    </div>
    <div class="site-tree layui-side layui-bg-black">
        <div class="layui-side-scroll" lay-filter="side">
            <ul class="layui-nav layui-nav-tree">
                <foreach name="menu_list" key="menu_identifier" item="menu">
                <if condition="empty($menu['children'])">
                <li class="layui-nav-item">
                <a href="{$menu.url}">{$menu.name}</a>
                </li>
                <else/>
                <li class="layui-nav-item">
                    <a href="javascript:;">{$menu.name}</a>
                    <dl class="layui-nav-child">
                        <foreach name="menu.children" key="childrenmenu_identifier" item="childmenu">
                        <dd><a href="{$childmenu.url}" style="margin-left: 10px;">{$childmenu.name}</a></dd>
                        </foreach>
                    </dl>
                  </li>
                </if>
                </foreach>
            </ul>
        </div>
    </div>
    <div class="layui-main layui-clear main">
        <block name="content"></block>
    </div>
    
    <div class="footer">
        <p>Copyright © 2017 Design By Huason <a class="site_url" href="http://www.miibeian.gov.cn/">闽ICP备17001904号</a></p>
    </div>

    <div class="layui-fixbar" id="gotop" style="display:none;right:20px;">
        <li class="layui-icon layui-fixbar-top" style="display: list-item;background-color:rgba(0, 0, 0, 0.7);">&#xe604;</li>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>
    {/*脚本*/}
    <script src="__JS__/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__JS__/calendar.js"></script>
    <script src="__JS__/base.js"></script>
    <script type="text/javascript">
    $(document).ready(function(e) {
        Base.initialize();
        Base.urls = {<block name="urls"></block>};
        CalendarHandler.initialize();
    });
    </script>
    <block name="javascript"></block>
    
</body>
</html>